package map.asteroids;

import com.jme.math.Quaternion;
import com.jme.math.Vector3f;

import logic.nodes.nodeSettings.Settings;

public class AsteroidProperties extends Settings {

	public static final String ASTEROID_ID = "asteroidID";
	public static final String POSITION = "position";
	public static final String ROTATION = "rotation";
	public static final String SCALE = "scale";
	public static final String RESOURCES = "resources";
	public static final String MODELPATH = "modelPath";
	
	public AsteroidProperties() {
		super();
	}
	
	public AsteroidProperties(Settings settings) {
		super(settings);
	}
	
	public Vector3f getPosition() {
		float x = Float.valueOf(getValueOf(POSITION + "X")).floatValue();
		float y = Float.valueOf(getValueOf(POSITION + "Y")).floatValue();
		float z = Float.valueOf(getValueOf(POSITION + "Z")).floatValue();
		return new Vector3f(x, y, z);
	}
	
	public Quaternion getRotation() {
		float x = Float.valueOf(getValueOf(ROTATION + "X")).floatValue();
		float y = Float.valueOf(getValueOf(ROTATION + "Y")).floatValue();
		float z = Float.valueOf(getValueOf(ROTATION + "Z")).floatValue();
		float w = Float.valueOf(getValueOf(ROTATION + "W")).floatValue();
		return new Quaternion(x, y, z, w);
	}
	
	public void setPosition(Vector3f pos) {
		addOption(POSITION + "X", pos.x + "");
		addOption(POSITION + "Y", pos.y + "");
		addOption(POSITION + "Z", pos.z + "");
	}
	
	public void setRotation(Quaternion rot) {
		addOption(ROTATION + "X", rot.x + "");
		addOption(ROTATION + "Y", rot.y + "");
		addOption(ROTATION + "Z", rot.z + "");
		addOption(ROTATION + "W", rot.w + "");
	}
	
	public int getAsteroidID() { return Integer.valueOf(getValueOf(ASTEROID_ID)).intValue(); }
	
	public void setAsteroidID(int asteroidID) { addOption(ASTEROID_ID, asteroidID + ""); }
	
	public void setScale(float scale) { addOption(SCALE, scale + ""); }
	
	public float getScale() { return Float.valueOf(getValueOf(SCALE)).floatValue(); }
	
	public void setResource(float res) { addOption(RESOURCES, res + ""); }
	
	public int getResource() { return Float.valueOf(getValueOf(RESOURCES)).intValue(); }
	
	public String getModelPath() { return getValueOf(MODELPATH); }
	
	public void setModelPath(String modelPath) { addOption(MODELPATH, modelPath); }
}